API: remove gdk_draw_rectangle()
authorBenjamin Otte <otte@redhat.com>
Sat, 17 Jul 2010 02:50:49 +0000 (04:50 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 10 Aug 2010 19:02:28 +0000 (21:02 +0200)
12 files changed:
docs/reference/gdk/gdk3-sections.txt
docs/reference/gdk/tmpl/drawing.sgml
gdk/directfb/gdkdrawable-directfb.c
gdk/gdk.symbols
gdk/gdkdraw.c
gdk/gdkdrawable.h
gdk/gdkoffscreenwindow.c
gdk/gdkpixmap.c
gdk/gdkwindow.c
gdk/quartz/gdkdrawable-quartz.c
gdk/win32/gdkdrawable-win32.c
gdk/x11/gdkdrawable-x11.c

index 0fd907b7d28ea1efa3c06202873dadb337416ca8..841fbffcf3f42f4bf91d150fa255708aeaecbf82 100644 (file)
@@ -334,7 +334,6 @@ gdk_drawable_get_clip_region
 gdk_drawable_get_visible_region
 
 <SUBSECTION>
-gdk_draw_rectangle
 gdk_draw_layout_line
 gdk_draw_layout_line_with_colors
 gdk_draw_layout
index fc5c18f5c66b7356eeb67523ea2804ad0654d1e6..866a7ab36c3c2865a1b8c906600322609f997adf 100644 (file)
@@ -127,23 +127,6 @@ or a #GdkWindow.
 @Returns: 
 
 
-<!-- ##### FUNCTION gdk_draw_rectangle ##### -->
-<para>
-</para>
-<note>
-<para>
-</para>
-</note>
-
-@drawable: 
-@gc: 
-@filled: 
-@x: 
-@y: 
-@width: 
-@height: 
-
-
 <!-- ##### FUNCTION gdk_draw_layout_line ##### -->
 <para>
 
index 238e92e08e502ae349b49f1bf0384a607475c107..0879c5b0fb75a2710c42c05e8a188ac1550e0b78 100644 (file)
@@ -397,158 +397,6 @@ gdk_directfb_setup_for_drawing (GdkDrawableImplDirectFB *impl,
   return TRUE;
 }
 
-static void
-gdk_directfb_draw_rectangle (GdkDrawable *drawable,
-                             GdkGC       *gc,
-                             gint         filled,
-                             gint         x,
-                             gint         y,
-                             gint         width,
-                             gint         height)
-{
-  GdkDrawableImplDirectFB *impl;
-  cairo_region_t                clip;
-  GdkGCDirectFB           *gc_private = NULL;
-  IDirectFBSurface        *surface    = NULL;
-  gint  i;
-
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-
-  D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %s, %4d,%4d - %4dx%4d )\n", G_STRFUNC,
-              drawable, gc, filled ? " filled" : "outline", x, y, width, height );
-
-  impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
-
-  if (!impl->surface)
-    return;
-
-  if (gc)
-    gc_private = GDK_GC_DIRECTFB (gc);
-
-  if (gc_private)
-    {
-      if (gdk_directfb_enable_color_keying &&
-         (gc_private->values.foreground.red   >> 8) == gdk_directfb_bg_color_key.r &&
-         (gc_private->values.foreground.green >> 8) == gdk_directfb_bg_color_key.g &&
-         (gc_private->values.foreground.blue  >> 8) == gdk_directfb_bg_color_key.b)
-       {
-          if (DFB_PIXELFORMAT_IS_INDEXED (impl->format))
-            impl->surface->SetColorIndex (impl->surface, 255);
-          else
-            impl->surface->SetColor (impl->surface,
-                                     gdk_directfb_bg_color.r,
-                                     gdk_directfb_bg_color.g,
-                                     gdk_directfb_bg_color.b,
-                                     gdk_directfb_bg_color.a);
-       }
-      else
-       {
-          if (!gdk_directfb_setup_for_drawing (impl, gc_private)){
-            return;
-                 }
-       }
-    }
-  else
-    {
-      GdkWindowObject *win = GDK_WINDOW_OBJECT (impl->wrapper);
-
-      if (gdk_directfb_enable_color_keying)
-       {
-          if (DFB_PIXELFORMAT_IS_INDEXED (impl->format))
-            impl->surface->SetColorIndex (impl->surface, 255);
-          else
-            impl->surface->SetColor (impl->surface,
-                                     gdk_directfb_bg_color.r,
-                                     gdk_directfb_bg_color.b,
-                                     gdk_directfb_bg_color.g,
-                                     gdk_directfb_bg_color.a);
-       }
-      else
-       {
-          gdk_directfb_set_color (impl, &win->bg_color, 0xFF);
-       }
-    }
-
-  if (filled)
-    {
-      GdkRectangle  rect = { x, y, width, height };
-
-      gdk_directfb_clip_region (drawable, gc, &rect, &clip);
-
-      if (gc_private && gc_private->values_mask & GDK_GC_FILL)
-        {
-          if (gc_private->values.fill == GDK_STIPPLED  &&
-              gc_private->values_mask & GDK_GC_STIPPLE &&
-              gc_private->values.stipple)
-            {
-              surface = GDK_DRAWABLE_IMPL_DIRECTFB (GDK_PIXMAP_OBJECT (gc_private->values.stipple)->impl)->surface;
-
-              if (surface)
-                impl->surface->SetBlittingFlags (impl->surface,
-                                                 (DSBLIT_BLEND_ALPHACHANNEL |
-                                                  DSBLIT_COLORIZE));
-            }
-          else if (gc_private->values.fill == GDK_TILED  &&
-                   gc_private->values_mask & GDK_GC_TILE &&
-                   gc_private->values.tile)
-            {
-              surface = GDK_DRAWABLE_IMPL_DIRECTFB (GDK_PIXMAP_OBJECT (gc_private->values.tile)->impl)->surface;
-
-              impl->surface->SetBlittingFlags (impl->surface, DSBLIT_NOFX);
-            }
-        }
-
-      if (surface)
-        {
-          if (gc_private->values_mask & GDK_GC_TS_X_ORIGIN)
-            x = gc_private->values.ts_x_origin;
-          if (gc_private->values_mask & GDK_GC_TS_Y_ORIGIN)
-            y = gc_private->values.ts_y_origin;
-
-          for (i = 0; i < clip.numRects; i++)
-            {
-              DFBRegion reg = { clip.rects[i].x1,     clip.rects[i].y1,
-                                clip.rects[i].x2, clip.rects[i].y2 };
-
-              impl->surface->SetClip (impl->surface, &reg);
-              impl->surface->TileBlit (impl->surface, surface, NULL, x, y);
-            }
-        }
-      else  /* normal rectangle filling */
-        {
-          DFBRectangle rects[clip.numRects];
-
-          impl->surface->SetClip (impl->surface, NULL);
-
-          for (i = 0; i < clip.numRects; i++)
-            {
-              cairo_region_tBox *box = &clip.rects[i];
-
-              rects[i].x = box->x1;
-              rects[i].y = box->y1;
-              rects[i].w = box->x2 - box->x1;
-              rects[i].h = box->y2 - box->y1;
-            }
-
-          impl->surface->FillRectangles(impl->surface, rects, clip.numRects);
-        }
-
-      temp_region_deinit( &clip );
-    }
-  else
-    {
-
-      DFBRegion region = { x, y, x + width, y + height };
-      impl->surface->SetClip (impl->surface, &region);
-
-      /*  DirectFB does not draw rectangles the X way. Using DirectFB,
-          a filled Rectangle has the same size as a drawn one, while
-          X draws the rectangle one pixel taller and wider.  */
-      impl->surface->DrawRectangle (impl->surface,
-                                    x, y, width , height);
-    }
-}
-
 static void
 gdk_directfb_draw_drawable (GdkDrawable *drawable,
                             GdkGC       *gc,
@@ -701,7 +549,6 @@ gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass)
   object_class->finalize = gdk_drawable_impl_directfb_finalize;
 
   drawable_class->create_gc      = _gdk_directfb_gc_new;
-  drawable_class->draw_rectangle = gdk_directfb_draw_rectangle;
   drawable_class->draw_drawable  = gdk_directfb_draw_drawable;
 
   drawable_class->ref_cairo_surface = gdk_directfb_ref_cairo_surface;
index 1bc019af6deda24a0a1834dd57643b6bde45daa9..ceb9753cd6c1148cf3e90c35539cffee3c5df54d 100644 (file)
@@ -550,7 +550,6 @@ gdk_drawable_get_visible_region
 gdk_drawable_get_visual
 gdk_drawable_set_colormap
 gdk_draw_drawable
-gdk_draw_rectangle
 #endif
 #endif
 
index 1051e44d57dcc9d44c06b340e2a6f5979dbe4ac3..90b44ba1767e2169f729bc729128383006977cde 100644 (file)
@@ -214,56 +214,6 @@ gdk_drawable_get_colormap (GdkDrawable *drawable)
 /* Drawing
  */
 
-/**
- * gdk_draw_rectangle:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @gc: a #GdkGC.
- * @filled: %TRUE if the rectangle should be filled.
- * @x: the x coordinate of the left edge of the rectangle.
- * @y: the y coordinate of the top edge of the rectangle.
- * @width: the width of the rectangle.
- * @height: the height of the rectangle.
- * 
- * Draws a rectangular outline or filled rectangle, using the foreground color
- * and other attributes of the #GdkGC.
- *
- * A rectangle drawn filled is 1 pixel smaller in both dimensions than a 
- * rectangle outlined. Calling 
- * <literal>gdk_draw_rectangle (window, gc, TRUE, 0, 0, 20, 20)</literal> 
- * results in a filled rectangle 20 pixels wide and 20 pixels high. Calling
- * <literal>gdk_draw_rectangle (window, gc, FALSE, 0, 0, 20, 20)</literal> 
- * results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20),
- * and (20, 0), which makes it 21 pixels wide and 21 pixels high.
- **/
-void
-gdk_draw_rectangle (GdkDrawable *drawable,
-                   GdkGC       *gc,
-                   gboolean     filled,
-                   gint         x,
-                   gint         y,
-                   gint         width,
-                   gint         height)
-{  
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-
-  if (width < 0 || height < 0)
-    {
-      gint real_width;
-      gint real_height;
-      
-      gdk_drawable_get_size (drawable, &real_width, &real_height);
-
-      if (width < 0)
-        width = real_width;
-      if (height < 0)
-        height = real_height;
-    }
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_rectangle (drawable, gc, filled, x, y,
-                                                     width, height);
-}
-
 /**
  * gdk_draw_drawable:
  * @drawable: a #GdkDrawable
index de741d3664cf9a5c242a56b4f8d15969e618f724..690d52effe9c892475762d938bd619216a9151a6 100644 (file)
@@ -60,13 +60,6 @@ struct _GdkDrawableClass
   GdkGC *(*create_gc)    (GdkDrawable    *drawable,
                          GdkGCValues    *values,
                          GdkGCValuesMask mask);
-  void (*draw_rectangle) (GdkDrawable  *drawable,
-                         GdkGC        *gc,
-                         gboolean      filled,
-                         gint          x,
-                         gint          y,
-                         gint          width,
-                         gint          height);
   void (*draw_drawable)  (GdkDrawable  *drawable,
                          GdkGC        *gc,
                          GdkDrawable  *src,
@@ -150,13 +143,6 @@ GdkDisplay*        gdk_drawable_get_display  (GdkDrawable    *drawable);
 
 /* Drawing
  */
-void gdk_draw_rectangle (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        gboolean          filled,
-                        gint              x,
-                        gint              y,
-                        gint              width,
-                        gint              height);
 void gdk_draw_drawable  (GdkDrawable      *drawable,
                         GdkGC            *gc,
                         GdkDrawable      *src,
index d582a08e7a4626f7b7c84b86d698d42c5a6233ab..a21ad163a0097b4e2f7b4c88bad8ed78711ddce4 100644 (file)
@@ -304,25 +304,6 @@ gdk_offscreen_window_draw_drawable (GdkDrawable *drawable,
   add_damage (offscreen, xdest, ydest, width, height, FALSE);
 }
 
-static void
-gdk_offscreen_window_draw_rectangle (GdkDrawable  *drawable,
-                                    GdkGC        *gc,
-                                    gboolean      filled,
-                                    gint          x,
-                                    gint          y,
-                                    gint          width,
-                                    gint          height)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-  GdkDrawable *real_drawable = get_real_drawable (offscreen);
-
-  gdk_draw_rectangle (real_drawable,
-                     gc, filled, x, y, width, height);
-
-  add_damage (offscreen, x, y, width, height, !filled);
-
-}
-
 void
 _gdk_offscreen_window_new (GdkWindow     *window,
                           GdkScreen     *screen,
@@ -947,7 +928,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   drawable_class->get_source_drawable = gdk_offscreen_window_get_source_drawable;
   drawable_class->get_composite_drawable = gdk_offscreen_window_get_composite_drawable;
 
-  drawable_class->draw_rectangle = gdk_offscreen_window_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_offscreen_window_draw_drawable;
 }
 
index 3d51dad5f17f371adf644b37d8b354b1038325b0..fdb3d29ec927001f1789abfb560bc8ffd3ad4834 100644 (file)
 static GdkGC *gdk_pixmap_create_gc      (GdkDrawable     *drawable,
                                          GdkGCValues     *values,
                                          GdkGCValuesMask  mask);
-static void   gdk_pixmap_draw_rectangle (GdkDrawable     *drawable,
-                                        GdkGC           *gc,
-                                        gboolean         filled,
-                                        gint             x,
-                                        gint             y,
-                                        gint             width,
-                                        gint             height);
 static void   gdk_pixmap_draw_drawable  (GdkDrawable     *drawable,
                                         GdkGC           *gc,
                                         GdkPixmap       *src,
@@ -109,7 +102,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   object_class->finalize = gdk_pixmap_finalize;
 
   drawable_class->create_gc = gdk_pixmap_create_gc;
-  drawable_class->draw_rectangle = gdk_pixmap_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_pixmap_draw_drawable;
   drawable_class->get_depth = gdk_pixmap_real_get_depth;
   drawable_class->get_screen = gdk_pixmap_real_get_screen;
@@ -189,22 +181,6 @@ gdk_pixmap_create_gc (GdkDrawable     *drawable,
                                  values, mask);
 }
 
-static void
-gdk_pixmap_draw_rectangle (GdkDrawable *drawable,
-                          GdkGC       *gc,
-                          gboolean     filled,
-                          gint         x,
-                          gint         y,
-                          gint         width,
-                          gint         height)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_rectangle (private->impl, gc, filled,
-                      x, y, width, height);
-}
-
 static void
 gdk_pixmap_draw_drawable (GdkDrawable *drawable,
                          GdkGC       *gc,
index 0554954d3b8f1b850a023dbcd55c636a5763ea51..1d0e2206dd23683bbe1c933679f6b6c1229d280e 100644 (file)
@@ -229,13 +229,6 @@ typedef struct {
 static GdkGC *gdk_window_create_gc      (GdkDrawable     *drawable,
                                         GdkGCValues     *values,
                                         GdkGCValuesMask  mask);
-static void   gdk_window_draw_rectangle (GdkDrawable     *drawable,
-                                        GdkGC           *gc,
-                                        gboolean         filled,
-                                        gint             x,
-                                        gint             y,
-                                        gint             width,
-                                        gint             height);
 static void   gdk_window_draw_drawable  (GdkDrawable     *drawable,
                                         GdkGC           *gc,
                                         GdkPixmap       *src,
@@ -424,7 +417,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   object_class->get_property = gdk_window_get_property;
 
   drawable_class->create_gc = gdk_window_create_gc;
-  drawable_class->draw_rectangle = gdk_window_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_window_draw_drawable;
   drawable_class->get_depth = gdk_window_real_get_depth;
   drawable_class->get_screen = gdk_window_real_get_screen;
@@ -3898,24 +3890,6 @@ gdk_window_create_gc (GdkDrawable     *drawable,
                                 values, mask);
 }
 
-static void
-gdk_window_draw_rectangle (GdkDrawable *drawable,
-                          GdkGC       *gc,
-                          gboolean     filled,
-                          gint         x,
-                          gint         y,
-                          gint         width,
-                          gint         height)
-{
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-  gdk_draw_rectangle (impl, gc, filled,
-                     x - x_offset, y - y_offset, width, height);
-  END_DRAW;
-}
-
 static GdkDrawable *
 gdk_window_get_source_drawable (GdkDrawable *drawable)
 {
index ec6ed52fb8a4ebda8f2e13b4ff068244af681e91..8cafe79e3b5797cd1ebf64498a048e957f3372d9 100644 (file)
@@ -147,43 +147,6 @@ gdk_quartz_get_depth (GdkDrawable *drawable)
   return gdk_drawable_get_depth (GDK_DRAWABLE_IMPL_QUARTZ (drawable)->wrapper);
 }
 
-static void
-gdk_quartz_draw_rectangle (GdkDrawable *drawable,
-                          GdkGC       *gc,
-                          gboolean     filled,
-                          gint         x,
-                          gint         y,
-                          gint         width,
-                          gint         height)
-{
-  CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
-
-  if (!context)
-    return;
-
-  _gdk_quartz_gc_update_cg_context (gc, 
-                                   drawable,
-                                   context,
-                                   filled ?
-                                   GDK_QUARTZ_CONTEXT_FILL : 
-                                   GDK_QUARTZ_CONTEXT_STROKE);
-
-  if (filled)
-    {
-      CGRect rect = CGRectMake (x, y, width, height);
-
-      CGContextFillRect (context, rect);
-    }
-  else
-    {
-      CGRect rect = CGRectMake (x + 0.5, y + 0.5, width, height);
-
-      CGContextStrokeRect (context, rect);
-    }
-
-  gdk_quartz_drawable_release_context (drawable, context);
-}
-
 static void
 gdk_quartz_draw_drawable (GdkDrawable *drawable,
                          GdkGC       *gc,
@@ -314,7 +277,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
   object_class->finalize = gdk_drawable_impl_quartz_finalize;
 
   drawable_class->create_gc = _gdk_quartz_gc_new;
-  drawable_class->draw_rectangle = gdk_quartz_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_quartz_draw_drawable;
 
   drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
index fae749f5e86e0ba0e826e2ad67eaf25126a95d53..b31ccadc89c214fbd2253a1b7b6b0996bdd4dd4b 100644 (file)
   (gcwin32->line_style == GDK_LINE_DOUBLE_DASH ||              \
    (gcwin32->line_style == GDK_LINE_ON_OFF_DASH && gcwin32->pen_dash_offset))
 
-static void gdk_win32_draw_rectangle (GdkDrawable    *drawable,
-                                     GdkGC          *gc,
-                                     gboolean        filled,
-                                     gint            x,
-                                     gint            y,
-                                     gint            width,
-                                     gint            height);
 static void gdk_win32_draw_drawable  (GdkDrawable    *drawable,
                                      GdkGC          *gc,
                                      GdkPixmap      *src,
@@ -95,7 +88,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   object_class->finalize = gdk_drawable_impl_win32_finalize;
 
   drawable_class->create_gc = _gdk_win32_gc_new;
-  drawable_class->draw_rectangle = gdk_win32_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_win32_draw_drawable;
   
   drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
@@ -424,240 +416,6 @@ draw_tiles (GdkDrawable *drawable,
   g_object_unref (gc_copy);
 }
 
-static void
-generic_draw (GdkDrawable    *drawable,
-             GdkGC          *gc,
-             GdkGCValuesMask mask,
-             void (*function) (GdkGCWin32 *, HDC, gint, gint, va_list),
-             const cairo_region_t *region,
-             ...)
-{
-  GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
-  GdkGCWin32 *gcwin32 = GDK_GC_WIN32 (gc);
-  HDC hdc;
-  va_list args;
-  GdkFill fill_style = _gdk_gc_get_fill (gc);
-
-  va_start (args, region);
-
-  /* If tiled or stippled, draw to a temp pixmap and do blitting magic.
-   */
-
-  if (gcwin32->values_mask & GDK_GC_FILL &&
-      ((fill_style == GDK_TILED &&
-       gcwin32->values_mask & GDK_GC_TILE &&
-       _gdk_gc_get_tile (gc) != NULL)
-       ||
-       ((fill_style == GDK_OPAQUE_STIPPLED ||
-        fill_style == GDK_STIPPLED) &&
-       gcwin32->values_mask & GDK_GC_STIPPLE &&
-       _gdk_gc_get_stipple (gc) != NULL)))
-    {
-      const GdkGCValuesMask blitting_mask = 0;
-      GdkGCValuesMask drawing_mask = GDK_GC_FOREGROUND;
-      gint ts_x_origin = 0, ts_y_origin = 0;
-      cairo_rectangle_int_t region_extents;
-
-      cairo_region_get_extents (region, &region_extents);
-
-      GdkPixmap *mask_pixmap =
-       gdk_pixmap_new (drawable, region_extents.width, region_extents.height, 1);
-      GdkPixmap *tile_pixmap =
-       gdk_pixmap_new (drawable, region_extents.width, region_extents.height, -1);
-      GdkPixmap *stipple_bitmap = NULL;
-      GdkColor fg;
-      
-      GdkGC *mask_gc = gdk_gc_new (mask_pixmap);
-      GdkGC *tile_gc = gdk_gc_new (tile_pixmap);
-
-      HDC mask_hdc;
-      HDC tile_hdc;
-
-      HGDIOBJ old_mask_hbm;
-      HGDIOBJ old_tile_hbm;
-
-      GdkGCValues gcvalues;
-
-      hdc = gdk_win32_hdc_get (drawable, gc, blitting_mask);
-      tile_hdc = CreateCompatibleDC (hdc);
-
-      if (gcwin32->values_mask & GDK_GC_TS_X_ORIGIN)
-       ts_x_origin = gc->ts_x_origin;
-      if (gcwin32->values_mask & GDK_GC_TS_Y_ORIGIN)
-       ts_y_origin = gc->ts_y_origin;
-
-      ts_x_origin -= region_extents.x;
-      ts_y_origin -= region_extents.y;
-
-      /* Fill mask bitmap with zeros */
-      gdk_gc_set_function (mask_gc, GDK_CLEAR);
-      gdk_draw_rectangle (mask_pixmap, mask_gc, TRUE,
-                         0, 0, region_extents.width, region_extents.height);
-
-      /* Paint into mask bitmap, drawing ones */
-      gdk_gc_set_function (mask_gc, GDK_COPY);
-      fg.pixel = 1;
-      gdk_gc_set_foreground (mask_gc, &fg);
-
-      /* If the drawing function uses line attributes, set them as in
-       * the real GC.
-       */
-      if (mask & LINE_ATTRIBUTES)
-       {
-         gdk_gc_get_values (gc, &gcvalues);
-         if (gcvalues.line_width != 0 ||
-             gcvalues.line_style != GDK_LINE_SOLID ||
-             gcvalues.cap_style != GDK_CAP_BUTT ||
-             gcvalues.join_style != GDK_JOIN_MITER)
-           gdk_gc_set_line_attributes (mask_gc,
-                                       gcvalues.line_width,
-                                       gcvalues.line_style,
-                                       gcvalues.cap_style,
-                                       gcvalues.join_style);
-         drawing_mask |= LINE_ATTRIBUTES;
-       }
-
-      mask_hdc = gdk_win32_hdc_get (mask_pixmap, mask_gc, drawing_mask);
-      (*function) (GDK_GC_WIN32 (mask_gc), mask_hdc,
-                  region_extents.x, region_extents.y, args);
-      gdk_win32_hdc_release (mask_pixmap, mask_gc, drawing_mask);
-
-      if (fill_style == GDK_TILED)
-       {
-         /* Tile pixmap with tile */
-         draw_tiles (tile_pixmap, tile_gc, SRCCOPY,
-                     _gdk_gc_get_tile (gc),
-                     0, 0, ts_x_origin, ts_y_origin,
-                     region_extents.width, region_extents.height);
-       }
-      else
-       {
-         /* Tile with stipple */
-         GdkGC *stipple_gc;
-
-         stipple_bitmap =
-           gdk_pixmap_new (NULL, region_extents.width, region_extents.height, 1);
-         stipple_gc = gdk_gc_new (stipple_bitmap);
-
-         /* Tile stipple bitmap */
-         draw_tiles (stipple_bitmap, stipple_gc, SRCCOPY,
-                     _gdk_gc_get_stipple (gc),
-                     0, 0, ts_x_origin, ts_y_origin,
-                     region_extents.width, region_extents.height);
-
-         if (fill_style == GDK_OPAQUE_STIPPLED)
-           {
-             /* Fill tile pixmap with background */
-             fg.pixel = _gdk_gc_get_bg_pixel (gc);
-             gdk_gc_set_foreground (tile_gc, &fg);
-             gdk_draw_rectangle (tile_pixmap, tile_gc, TRUE,
-                                 0, 0,
-                                 region_extents.width, region_extents.height);
-           }
-         g_object_unref (stipple_gc);
-       }
-
-      g_object_unref (mask_gc);
-      g_object_unref (tile_gc);
-
-      mask_hdc = CreateCompatibleDC (hdc);
-
-      if ((old_mask_hbm = SelectObject (mask_hdc, GDK_PIXMAP_HBITMAP (mask_pixmap))) == NULL)
-       WIN32_GDI_FAILED ("SelectObject");
-
-      if ((old_tile_hbm = SelectObject (tile_hdc, GDK_PIXMAP_HBITMAP (tile_pixmap))) == NULL)
-       WIN32_GDI_FAILED ("SelectObject");
-
-      if (fill_style == GDK_STIPPLED ||
-         fill_style == GDK_OPAQUE_STIPPLED)
-       {
-         HDC stipple_hdc;
-         HGDIOBJ old_stipple_hbm;
-         HBRUSH fg_brush;
-         HGDIOBJ old_tile_brush;
-
-         if ((stipple_hdc = CreateCompatibleDC (hdc)) == NULL)
-           WIN32_GDI_FAILED ("CreateCompatibleDC");
-
-         if ((old_stipple_hbm =
-              SelectObject (stipple_hdc,
-                            GDK_PIXMAP_HBITMAP (stipple_bitmap))) == NULL)
-           WIN32_GDI_FAILED ("SelectObject");
-
-         if ((fg_brush = CreateSolidBrush
-              (_gdk_win32_colormap_color (impl->colormap,
-                                          _gdk_gc_get_fg_pixel (gc)))) == NULL)
-           WIN32_GDI_FAILED ("CreateSolidBrush");
-
-         if ((old_tile_brush = SelectObject (tile_hdc, fg_brush)) == NULL)
-           WIN32_GDI_FAILED ("SelectObject");
-
-         /* Paint tile with foreround where stipple is one
-          *
-          *  Desired ternary ROP: (P=foreground, S=stipple, D=destination)
-           *   P   S   D   ?
-           *   0   0   0   0
-           *   0   0   1   1
-           *   0   1   0   0
-           *   0   1   1   0
-           *   1   0   0   0
-           *   1   0   1   1
-           *   1   1   0   1
-           *   1   1   1   1
-          *
-          * Reading bottom-up: 11100010 = 0xE2. PSDK docs say this is
-          * known as DSPDxax, with hex value 0x00E20746.
-          */
-         GDI_CALL (BitBlt, (tile_hdc, 0, 0,
-                            region_extents.width, region_extents.height,
-                            stipple_hdc, 0, 0,
-                            ROP3_DSPDxax));
-
-         if (fill_style == GDK_STIPPLED)
-           {
-             /* Punch holes in mask where stipple is zero */
-             GDI_CALL (BitBlt, (mask_hdc, 0, 0,
-                                region_extents.width, region_extents.height,
-                                stipple_hdc, 0, 0,
-                                SRCAND));
-           }
-
-         GDI_CALL (SelectObject, (tile_hdc, old_tile_brush));
-         GDI_CALL (DeleteObject, (fg_brush));
-         GDI_CALL (SelectObject, (stipple_hdc, old_stipple_hbm));
-         GDI_CALL (DeleteDC, (stipple_hdc));
-         g_object_unref (stipple_bitmap);
-       }
-
-      /* Tile pixmap now contains the pattern that we should paint in
-       * the areas where mask is one. (It is filled with said pattern.)
-       */
-
-      GDI_CALL (MaskBlt, (hdc, region_extents.x, region_extents.y,
-                         region_extents.width, region_extents.height,
-                         tile_hdc, 0, 0,
-                         GDK_PIXMAP_HBITMAP (mask_pixmap), 0, 0,
-                         MAKEROP4 (rop2_to_rop3 (gcwin32->rop2), ROP3_D)));
-
-      /* Cleanup */
-      GDI_CALL (SelectObject, (mask_hdc, old_mask_hbm));
-      GDI_CALL (SelectObject, (tile_hdc, old_tile_hbm));
-      GDI_CALL (DeleteDC, (mask_hdc));
-      GDI_CALL (DeleteDC, (tile_hdc));
-      g_object_unref (mask_pixmap);
-      g_object_unref (tile_pixmap);
-
-      gdk_win32_hdc_release (drawable, gc, blitting_mask);
-    }
-  else
-    {
-      hdc = gdk_win32_hdc_get (drawable, gc, mask);
-      (*function) (gcwin32, hdc, 0, 0, args);
-      gdk_win32_hdc_release (drawable, gc, mask);
-    }
-  va_end (args);
-}
-
 static cairo_region_t *
 widen_bounds (GdkRectangle *bounds,
              gint          pen_width)
@@ -673,84 +431,6 @@ widen_bounds (GdkRectangle *bounds,
   return cairo_region_create_rectangle (bounds);
 }
 
-static void
-draw_rectangle (GdkGCWin32 *gcwin32,
-               HDC         hdc,
-               gint        x_offset,
-               gint        y_offset,
-               va_list     args)
-{
-  HGDIOBJ old_pen_or_brush;
-  gboolean filled;
-  gint x;
-  gint y;
-  gint width;
-  gint height;
-
-  filled = va_arg (args, gboolean);
-  x = va_arg (args, gint);
-  y = va_arg (args, gint);
-  width = va_arg (args, gint);
-  height = va_arg (args, gint);
-  
-  x -= x_offset;
-  y -= y_offset;
-
-  if (!filled && MUST_RENDER_DASHES_MANUALLY (gcwin32))
-    {
-      render_line_vertical (gcwin32, x, y, y+height+1) &&
-      render_line_horizontal (gcwin32, x, x+width+1, y) &&
-      render_line_vertical (gcwin32, x+width+1, y, y+height+1) &&
-      render_line_horizontal (gcwin32, x, x+width+1, y+height+1);
-    }
-  else
-    {
-      if (filled)
-       old_pen_or_brush = SelectObject (hdc, GetStockObject (NULL_PEN));
-      else
-       old_pen_or_brush = SelectObject (hdc, GetStockObject (HOLLOW_BRUSH));
-      if (old_pen_or_brush == NULL)
-       WIN32_GDI_FAILED ("SelectObject");
-      else
-       GDI_CALL (Rectangle, (hdc, x, y, x+width+1, y+height+1));
-
-      if (old_pen_or_brush != NULL)
-       GDI_CALL (SelectObject, (hdc, old_pen_or_brush));
-    }
-}
-
-static void
-gdk_win32_draw_rectangle (GdkDrawable *drawable,
-                         GdkGC       *gc,
-                         gboolean     filled,
-                         gint         x,
-                         gint         y,
-                         gint         width,
-                         gint         height)
-{
-  GdkRectangle bounds;
-  cairo_region_t *region;
-
-  GDK_NOTE (DRAW, g_print ("gdk_win32_draw_rectangle: %s (%p) %s%dx%d@%+d%+d\n",
-                          _gdk_win32_drawable_description (drawable),
-                          gc,
-                          (filled ? "fill " : ""),
-                          width, height, x, y));
-    
-  bounds.x = x;
-  bounds.y = y;
-  bounds.width = width;
-  bounds.height = height;
-  region = widen_bounds (&bounds, GDK_GC_WIN32 (gc)->pen_width);
-
-  generic_draw (drawable, gc,
-               GDK_GC_FOREGROUND | GDK_GC_BACKGROUND |
-               (filled ? 0 : LINE_ATTRIBUTES),
-               draw_rectangle, region, filled, x, y, width, height);
-
-  cairo_region_destroy (region);
-}
-
 static void
 gdk_win32_draw_drawable (GdkDrawable *drawable,
                         GdkGC       *gc,
index 53cd107ed2abed5a6b57c5291c89a55a62ee0641..2a4d9ac7e1a5c2e4f48235e344d224defd2610ad 100644 (file)
 #include "gdkdisplay-x11.h"
 
 
-static void gdk_x11_draw_rectangle (GdkDrawable    *drawable,
-                                   GdkGC          *gc,
-                                   gboolean        filled,
-                                   gint            x,
-                                   gint            y,
-                                   gint            width,
-                                   gint            height);
 static void gdk_x11_draw_drawable  (GdkDrawable    *drawable,
                                    GdkGC          *gc,
                                    GdkPixmap      *src,
@@ -91,7 +84,6 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
   object_class->finalize = gdk_drawable_impl_x11_finalize;
   
   drawable_class->create_gc = _gdk_x11_gc_new;
-  drawable_class->draw_rectangle = gdk_x11_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_x11_draw_drawable;
   
   drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
@@ -288,27 +280,6 @@ gdk_x11_set_colormap (GdkDrawable *drawable,
 /* Drawing
  */
 
-static void
-gdk_x11_draw_rectangle (GdkDrawable *drawable,
-                       GdkGC       *gc,
-                       gboolean     filled,
-                       gint         x,
-                       gint         y,
-                       gint         width,
-                       gint         height)
-{
-  GdkDrawableImplX11 *impl;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-  
-  if (filled)
-    XFillRectangle (GDK_SCREEN_XDISPLAY (impl->screen), impl->xid,
-                   GDK_GC_GET_XGC (gc), x, y, width, height);
-  else
-    XDrawRectangle (GDK_SCREEN_XDISPLAY (impl->screen), impl->xid,
-                   GDK_GC_GET_XGC (gc), x, y, width, height);
-}
-
 static void
 gdk_x11_draw_drawable (GdkDrawable *drawable,
                       GdkGC       *gc,